package com.g1.service.impl;

import com.g1.entity.Food;
import com.g1.mapper.FoodMapper;
import com.g1.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FoodServiceImp implements FoodService {
    @Autowired
    private FoodMapper foodMapper;

    @Override
    public List<Food> list() { return foodMapper.listM(); }

    @Override
    public Food get(int id) { return foodMapper.getM(id); }

    @Override
    public int add(Food food) {
        return foodMapper.addM(food);
    }

    @Override
    public void delete(int id) { foodMapper.deleteM(id); }

    @Override
    public int edit(Food food) {
        return foodMapper.editM(food);
    }
}
